package StudyCode.summary.myfile;

import java.io.*;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CopyOneToAnotherOne {

	public static void main(String[] args) throws Exception {
		File src = new File("E:\\迅雷下载\\test1.txt");
		File dst = new File("E:\\Copy\\test1.txt");
		InputStream in = new FileInputStream(src);
		OutputStream out = new FileOutputStream(dst);

		byte[] buf = new byte[1024];
		int len;
		while ((len = in.read(buf)) > 0) {
			out.write(buf, 0, len);
		}
		System.out.println("复制成功。");
		in.close();
		out.close();
	}
}
